#!/bin/bash

die() {
	echo "#####"
	echo $1
	echo "#####"
	exit 1
}

if [ $1 = "install" ]; then
	sed -e "s|/home/metadot/metadot|${MY_INSTALLDIR}|g" -i ${MY_INSTALLDIR}/etc/metadot.conf || die
	# fix Apache configs
	sed -e "s|ROOTDIR|${MY_INSTALLDIR}|g
	s|VHOST|${VHOST_HOSTNAME}|" -i ${VHOST_ROOT}/metadot.conf || die

elif [ $1 = "clean" ]; then
	echo $1
fi
